/***************************************************************************
	Copyright (C) 2013 Aditya Nag Matsa 
    
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
****************************************************************************/

#ifndef ASTAR_H
#define ASTAR_H

#define WIDTH 40    //  Width of the problem
#define LENGTH 40   //  Height of the problem
#define ALLOW '0'   //  What character represents the path which the agent CAN travel?
#define PATH ' '    //  What character represents path travelled?

#include <stdio.h>
#include <math.h>
#include <stdlib.h>

struct pointdata {
	int x;
	int y;
	float g;
	float f;
	struct pointdata *from;
};

typedef struct pointdata Point;

struct node {
	Point *location;
	struct node *next;
};

typedef struct node Node;

//	Function Prototypes
int equalElements (Point *, Point *);
int nodeCount (Node *);
Node * nodeDelete (Point *, Node *);
Node * nodeAppend (Point *, Node *);
int nodeSearch (Point *, Node *);
Point * priority (Node *);
float distance (Point *, Point *);
float heuristic (Point *, Point *);
void neighborNodes (Point *, Point *, FILE *);
void reconstructPath (Point *, FILE *);
void print(Node *, FILE *);

#endif
